<% for article in @articles %>
  <h2><%= link_to h(article.title),
                  :action => 'article', :id => article %></h2>

  <div><%= article.body_html %></div>

  <div class="article-info">
    by <%= article.user.name %> |
    <%= link_to article.created_at.strftime("%Y-%m-%d %H:%M"),
                :action => 'article', :id => article %> |
    <%= link_to h(article.category.name),
                :action => 'category', :id => article.category %> |
    <% if article.tags.size > 0 %>
    <%= article.tags.map {|tag| link_to h(tag.name),
                                        :action => 'tag',
                                        :id => tag}.join(", ") %> |
    <% end %>
    <%= link_to "댓글(#{article.comments.size})",
                :action => 'article', :id => article %>
  </div>
<% end %>

<%= pagination_links(@article_pages) %>
